package com.wf.it.hpplan.dao;

import com.wf.it.common.entity.Plan;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PlanDao extends JpaRepository<Plan,Integer> , JpaSpecificationExecutor<Plan> {
    List<Plan> findByDocEmpNo(String empno);
    @Modifying
    @Query(nativeQuery=true,value="update plans set plan_bookcount=plan_bookcount+?2 where plan_id=?1")
    void updateBookCount(int planid, int num);
}
